const typeArray = ['全部','有脚纽扣','女装用扣','锌合金纽扣','新款','商场专柜','手缝扣','JIDI系列','衬衫T恤用扣',
  '极简轻奢分','英伦学院风徽章标志','滴胶喷漆款','经典款','复古风'];

const commodNames = ['镂空点油手缝扣','点油钻扣',
                    '斜边点油手缝扣','花型点油手缝扣',
                    '狮头组合手缝扣','点油手缝扣',
                    '半边脸点油手缝扣','牛头手缝扣','突面点油钻扣']

const commodImgs = ['https://img01.yzcdn.cn/upload_files/2021/07/06/Fm5cROwZe3wyJGMIQzyseyothPL5.jpg!large.webp',
'https://img01.yzcdn.cn/upload_files/2021/07/06/Fqgfxk8ceGtdJDKvSblNrv1ttDT1.jpg!large.webp',
'https://img.yzcdn.cn/upload_files/2021/09/22/FqisOrXW21NdMk-S8nVxJ2eK8rQO.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/08/09/FnO5AqLV_leBjJF122aEisFY9Ggh.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/29/Fn1IgA5Brs_UKpMG-1vbfG1FGKao.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/09/11/Fp6cxt4MSTE5qFkgFPy7WeM8oBnA.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/06/FidGg5YaECVpqmg3w4aTwXKQmHWy.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/06/Foqom3iMRYDrhtsLNEFAetXRFvD8.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/15/Fh8U1qevk2Ktg9hSWtkdUCKgFW7d.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/08/FtzpizmrapU8R3i1-nnY1fy_5uFs.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg',
'https://img.yzcdn.cn/upload_files/2021/07/24/Fm8L-XefJGISanmYj5-WShcd7323.jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg?imageView2/2/w/400/h/0/q/75/format/jpg']

//随机生成品种
const distributionType = (type) => {
  switch (type){
    case "类型":{
      let typeString = '';
      for(let i=0;i<5;++i){
        typeString += typeArray[Math.floor(Math.random()*10)]+',';
      }
      return typeString;
    }
    case "名称":{
      let typeString = '';
        typeString += commodNames[Math.floor(Math.random()*9)]+',';
      return typeString.slice(0,typeString.length-1);
    }
    case "头图":{
      let typeString = '';
      typeString += commodImgs[Math.floor(Math.random()*11)];
      return typeString;
    }
  }

}

//生成30条假数据
 const dirstributionItem = () => {
  let itemArr = [];
  for(let i = 0;i<30;++i){
    itemArr = [...itemArr,{
      id:i,
      url:distributionType('头图'),
      name:distributionType('名称'),
      money:Math.floor(Math.random()*10+1)/10,
      type:distributionType('类型'),
      scale:Math.floor(40+Math.random()*60)
    }]
  }
  return itemArr;
}

export default dirstributionItem();
